package com.turing.customer.customerLine;

import com.turing.customer.mapper.CustomerMapper;
import org.springframework.boot.CommandLineRunner;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Component
public class InitRedis implements CommandLineRunner {

    @Resource private CustomerMapper customerMapper;

    @Resource private RedisTemplate redisTemplate;



    @Override
    public void run(String... args) throws Exception {
//        List<Map> list = customerMapper.listMerComments();
//        ZSetOperations valueOps = redisTemplate.opsForZSet();
//        for (Map map : list) {
//            valueOps.add("cusComments", map.get("id"), (Long) map.get("counts"));
//        }
    }
}
